import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { createSwaggerDocument } from './utils/swagger';
import { ResponseFormatInterceptor } from './interceptor/response.format';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  // swagger文档
  createSwaggerDocument(app);
  // 拦截器：返回请求格式化
  app.useGlobalInterceptors(new ResponseFormatInterceptor());
  await app.listen(3000);
}
bootstrap();
